package com.lc.big_event.validation;

import com.lc.big_event.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

/**
 * @author liuchun
 */
public class StateValidation implements ConstraintValidator<State,String> {

    public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
        if (value == null){
            return false;
        }
        if (value.equals("已发布")|value.equals("草稿")){
            return true;
        }
        return false;
    }
}
